﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Conference.Logic.Schedule
{
    /// <summary>
    /// Class that represents a track, e.g. one whole day.
    /// </summary>
    public class Track
    {
        #region Attributes
        private int day;
        private Moorning moorning;
        private Afternoon afternoon;
        #endregion

        #region Properties
        public int Day
        {
            get { return this.day; }
            set 
            {
                if (value > 0)
                    this.day = value;
                else
                    throw new Exception("Invalid property value!");
            }
        }

        public Moorning Moorning
        {
            get { return this.moorning; }
            set
            {
                if (value != null)
                    this.moorning = value;
                else
                    throw new Exception("Invalid property value!");
            }
        }

        public Afternoon Afternoon
        {
            get { return this.afternoon; }
            set
            {
                if (value != null)
                    this.afternoon = value;
                else
                    throw new Exception("Invalid property value!");
            }
        }
        #endregion

        #region Constructor
        /// <summary>
        /// Instantiate a new track class and start necessary objects 
        /// </summary>
        /// <param name="day"></param>
        public Track(int day)
        {
            try
            {
                this.Day = day;
                this.moorning = new Moorning();
                this.afternoon = new Afternoon();
            }
            catch (Exception ex)
            {                
                throw ex;
            }
        }
        #endregion
    }
}
